Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Federation] Add an end-to-end test verifying that deleting a federated namespace deletes child replicasets. #41278

Merged
merged 1 commit into from
Feb 14, 2017

Conversation

perotinus
Copy link
Contributor

Verifies #38225.

Also, remove a few custom package aliases.

@k8s-ci-robot
Copy link
Contributor

Hi @perotinus. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

1 similar comment
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 11, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-label-needed labels Feb 11, 2017
@perotinus
Copy link
Contributor Author

cc @madhusudancs

@perotinus perotinus force-pushed the nsdeletion-e2etest branch 3 times, most recently from caf0f25 to 1bd1408 Compare February 11, 2017 01:12
@perotinus
Copy link
Contributor Author

I signed it!

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 11, 2017
@madhusudancs madhusudancs added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Feb 11, 2017
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2017
@madhusudancs
Copy link
Contributor

A couple of minor nits but mostly looks good.

Also, please rebase.


Review status: 0 of 1 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


test/e2e_federation/federated-namespace.go, line 103 at r1 (raw file):

			nsName := createNamespace(f.FederationClientset.Core().Namespaces())
			rsName := v1.SimpleNameGenerator.GenerateName(eventNamePrefix)

By convention, eventNamePrefix is used for Event API type object names. Please define another const for replicasets and use that const here.


test/e2e_federation/federated-namespace.go, line 143 at r1 (raw file):

			By(fmt.Sprintf("Verify that replicaset %s was deleted as well", rsName))
			err = wait.Poll(5*time.Second, wait.ForeverTestTimeout, func() (bool, error) {

I recommend pulling this and

err = wait.Poll(5*time.Second, wait.ForeverTestTimeout, func() (bool, error) {
into a common helper function.


Comments from Reviewable

@perotinus perotinus force-pushed the nsdeletion-e2etest branch 2 times, most recently from c7d231d to 089c589 Compare February 13, 2017 22:14
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 13, 2017
@perotinus
Copy link
Contributor Author

Thanks, @madhusudancs! PTAL when you get a chance.

@perotinus
Copy link
Contributor Author

Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions.


test/e2e_federation/federated-namespace.go, line 103 at r1 (raw file):

Previously, madhusudancs (Madhusudan.C.S) wrote…

By convention, eventNamePrefix is used for Event API type object names. Please define another const for replicasets and use that const here.

Done.


test/e2e_federation/federated-namespace.go, line 143 at r1 (raw file):

Previously, madhusudancs (Madhusudan.C.S) wrote…

I recommend pulling this and

err = wait.Poll(5*time.Second, wait.ForeverTestTimeout, func() (bool, error) {
into a common helper function.

Done.


Comments from Reviewable

@madhusudancs
Copy link
Contributor

Reviewed 2 of 3 files at r2.
Review status: 2 of 3 files reviewed at latest revision, 2 unresolved discussions.


test/e2e_federation/federation-util.go, line 530 at r2 (raw file):

}

/*

It is a convention to use // on each line for docstrings.


Comments from Reviewable

@perotinus
Copy link
Contributor Author

Review status: 2 of 3 files reviewed at latest revision, 2 unresolved discussions.


test/e2e_federation/federation-util.go, line 530 at r2 (raw file):

Previously, madhusudancs (Madhusudan.C.S) wrote…

It is a convention to use // on each line for docstrings.

Ah, OK. Done.

Should we fix the other comments in this file, perhaps in a follow-up PR?


Comments from Reviewable

@madhusudancs
Copy link
Contributor

Reviewed 1 of 3 files at r2, 1 of 2 files at r3.
Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion.


test/e2e_federation/federation-util.go, line 530 at r2 (raw file):

Previously, perotinus (Jonathan MacMillan) wrote…

Ah, OK. Done.

Should we fix the other comments in this file, perhaps in a follow-up PR?

Follow up PR for other instances would be great. I will LGTM and approve this PR.


Comments from Reviewable

@madhusudancs madhusudancs self-assigned this Feb 13, 2017
@madhusudancs
Copy link
Contributor

/lgtm
/approve


Reviewed 1 of 2 files at r3.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from Reviewable

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2017
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2017
…ed namespace deletes child replicasets.

Verifies kubernetes#38225.

Also, remove a few custom package aliases.
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

The following people have approved this PR: madhusudancs, perotinus

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2017
@perotinus
Copy link
Contributor Author

Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion.


test/e2e_federation/federation-util.go, line 530 at r2 (raw file):

Previously, madhusudancs (Madhusudan.C.S) wrote…

Follow up PR for other instances would be great. I will LGTM and approve this PR.

Thanks! I'll start working on that now.


Comments from Reviewable

@perotinus
Copy link
Contributor Author

@k8s-bot verify test this

@k8s-ci-robot
Copy link
Contributor

@perotinus: you can't request testing unless you are a kubernetes member.

In response to this comment:

@k8s-bot verify test this

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@madhusudancs
Copy link
Contributor

@k8s-bot ok to test

@perotinus
Copy link
Contributor Author

@madhusudancs Can you re-LGTM?

@madhusudancs
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 14, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 41357, 41178, 41280, 41184, 41278)

@k8s-github-robot k8s-github-robot merged commit 8db5ca1 into kubernetes:master Feb 14, 2017
perotinus added a commit to perotinus/kubernetes that referenced this pull request Feb 15, 2017
k8s-github-robot pushed a commit that referenced this pull request Feb 16, 2017
Automatic merge from submit-queue (batch tested with PRs 41505, 41484, 41544, 41514, 41022)

[Federation] Fixes the newly-added test for replicaset deletion upon namespace deletion.

See #41278 for the original test.

**Release note**:
```release-note
NONE
```
ahakanbaba pushed a commit to ahakanbaba/kubernetes that referenced this pull request Feb 17, 2017

By(fmt.Sprintf("Verify that replicaset %s was deleted as well", rsName))

waitForReplicaSetToBeDeletedOrFail(f.FederationClientset, nsName, rsName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not require a wait here. Replicaset should have been deleted before the namespace was deleted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the delete namespace operation is synchronous, i.e. it won't return until the namespace cleanup is complete?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the function that this test is using to delete namespace is synchronous. It waits for the namespace to be deleted before returning.
So here, we can directly check that the replicaset is gone. No need to wait again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After following this commentary, I'd suggest appending a suffix to deleteNamespace to indicate that it is synchronous (+Sync or +AndWait, whichever....).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikhiljindal makes sense.

@csbell good idea.

@perotinus is this something that you can fix?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use AndWait in kubernetes tests often, so we can stick with that I guess.

@perotinus perotinus deleted the nsdeletion-e2etest branch May 10, 2017 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants